{if $full_page}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
<link rel="stylesheet" href="Res/boot/css/bootstrap.min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="Res/boot/css/bootstrap-theme.min.css" type="text/css" media="screen" />
<script type="text/javascript" src="Res/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="Res/js/jquery.cookie.js"></script>
<script type="text/javascript" src="Res/boot/js/bootstrap.min.js"></script>
<script type="text/javascript" src="Res/js/listTable.js"></script>
<link rel="stylesheet" href="Res/css/page.css" type="text/css" />
<link rel="stylesheet" href="Res/css/global.css" type="text/css" />
{literal}
<style>
    .listDiv{margin:0 auto;}  
    table tbody td lable:hover{background-color:#00E8D7}
</style>
{/literal}
</head>
<body>
<div class="container-fluid">
	<div class="row-fluid">
            <div class="span12 panel panel-info">                
                <span class="cp_title">{$title}</span>
                <div class="add_cp">
                        <a href="index.php?c=storysource&m=create">+添加来源</a>
                </div>
                <div class="panel-heading">
                    <label for="action_code">来源名称:</label>
                    <input class="input-medium search-query" id="sname" name="sname" type="text" placeholder="来源名称" />   
   
                    <button type="button" id="btn_search" class="btn btn-success">查找</button>                        
                </div>
 
                <div class="listDiv" id="listDiv">
{/if}
                <table id="data_table_id" class="table table-hover table-bordered">
                    <thead>
                    <tr>                        
                        <th>ID</th>
                        <th>名称</th>
                        <th>URL</th>
                        <th>显示状态</th>
                        <th>加入时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>    
                        {foreach from=$data.pageData item=row}
                        <tr>
                            <td>{$row.id}</td>
                            <td><lable onclick="listTable.edit(this, 'edit_fields', {$row.ssid}, 'sname')" 
                               title="点击修改">{$row.sname}</lable></td>
                            <td><lable onclick="listTable.edit(this, 'edit_fields', {$row.ssid}, 'sname')" 
                                       title="点击修改">{$row.url}</lable></td>                            
                            <td style="text-align:center;">
                                <span class="glyphicon {$row.is_show}" style="cursor:pointer;font-size: 16px;line-height: 28px;" 
                                      onclick="listTable.toggle(this,{$row.ssid}, 'is_show')"></span>
                            </td>
                            <td>{$row.in_time_format}</td>
                            <td style="text-align:center;">          
                                <button class="btn btn-info" type="button" onclick="del({$row.ssid})">
                                    <span class="glyphicon glyphicon-trash"></span>
                                </button>
                            </td>
                        </tr>
                        {/foreach}
                    </tbody>
                    <tfoot>
                        <!-- 分页数据 -->
                        <tr>
                            <td colspan="8"><div class="iPageHtml">{$data.pageHtml}</div></td>
                        </tr>
                    </tfoot>
                </table>
{if $full_page}
                </div>
            </div>
	</div>
</div>
<div style="clear:both;"></div>
{literal}
<script type="text/javascript">
    listTable.m = 'query';
    listTable.divid = 'listDiv';
    $("#btn_search").click(function(){
        listTable.filter['page'] =1;
        listTable.filter['sname'] = $("#sname").val();
        listTable.loadList();
    });
    function del(id) {
        if(!confirm("确定要删除吗?")) {
            return false;
        }
        var params = new Object();
        params.id = id;
        params.ajax = 1;
        $.post('index.php?c=storysource&m=del', params, function(data) {
            if(data.status == 0) {
                alert(data.msg)
                listTable.loadList();
            } else {
                alert(data.msg);
            }
        }, 'json');
    }
</script>
{/literal}
</body>
</html>
{/if}